﻿using AutoMapper;
using CIK.News.Domain;
using CIK.News.Web.Infrastructure.Security;

namespace CIK.News.Web.Infrastructure.Profiles
{
    public class UserMapperProfile : Profile
    {
        protected override void Configure()
        {
            Mapper.CreateMap<User, UserInfo>()
                .ForMember(x => x.UserName, o => o.MapFrom(m => m.UserName))
                .ForMember(x => x.DisplayName, o => o.MapFrom(m => m.DisplayName))
                .ForMember(x => x.Email, o => o.MapFrom(m => m.Email))
                .ForMember(x => x.UserId, o => o.MapFrom(m => m.Id))
                .ForMember(x => x.GroupId, o => o.MapFrom(m => m.Role));
        }
    }
}